<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
  <head>
    <title>Login</title>
    <meta charset="utf-8" />
    <meta name="description" content="" />
    <meta name="keywords" content="" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <link th:href="@{https://fonts.googleapis.com/css?family=Playfair+Display:400,400i,700,700i,900,900i}" rel="stylesheet" />
    <link th:href="@{https://fonts.googleapis.com/css?family=Roboto:100,100i,300,300i,400,400i,500,500i,700,700i,900,900i}" rel="stylesheet" />
    <link rel="stylesheet" type="text/css" th:href="@{/mall/revolution/css/settings.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/mall/revolution/css/layers.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/mall/revolution/css/navigation.css}"/>
    <link rel="stylesheet" type="text/css" th:href="@{/mall/css/main.css}" />

  </head>
  <body class="animsition">
  <div class="checkout" id="page">
      <nav id="menu">
          <ul>
              <li><a th:href="@{/fore/index.html}">Home</a></li>
              <li><a th:href="@{/fore/shop.html}">Shop List</a></li>
              <li><a th:href="@{/fore/shop-detail.html}">Shop Detail</a><li>
              <li><a th:href="@{/fore/wish-list.html}">Wishlist</a></li>
              <li><a th:href="@{/fore/shop-cart.html}">Shop Cart</a></li>
              <li><a th:href="@{/fore/check-out.html}">Checkout</a></li>
          </ul>
      </nav>
      <div th:replace="@{/include/fore_header}::header"></div>
      <section class="sub-header shop-detail-1">
          <img class="rellax bg-overlay" th:src="@{/mall/images/sub-header/015.jpg}" alt="">
          <div class="overlay-call-to-action"></div>
          <h3 class="heading-style-3">登录</h3>
      </section>
      <section class="boxed-sm">

          <div class="container">
              <div class="woocommerce">
                  <div class="woocommerce-info-wrapper">
                      <div class="row">

                      </div>
                  </div>
                  <div class="row">
                      <form id="loginForm" class="woocommerce-checkout" role="form" th:action="@{/customer/login}" method="post">
<!--                          <h4>登录</h4>-->
                          <div class="row">
                              <div class="col-md-4"></div>
                              <div class="col-md-4">
                                  <div class="form-group organic-form no-radius">
                                      <label>用户名</label>
                                      <input class="form-control" type="text" name="customerName">
                                  </div>
                              </div>

                          </div>
                          <div class="row">
                              <div class="col-md-4"></div>
                              <div class="col-md-4">
                                  <div class="form-group organic-form no-radius">
                                      <label>密码</label>
                                      <input class="form-control" type="Password" name="customerPassword">
                                  </div>
                              </div>
                          </div>

                          <div class="row">
                              <div class="col-md-4"></div>
                              <div class="col-md-4">
                                  <div class="woocommerce-account-fields">

                                      <div class="desc widget-link">
                                          <ul >
                                              <li class="list-unstyle">
                                                  <a th:href="@{/fore/register.html}" style="margin-right: 15px;">新建账号</a>
                                                  <a th:href="@{/fore/forget.html}">忘记密码</a>
                                                  <input class="place_order btn btn-brand-ghost pill " id="loginSubmit" name="woocommerce_checkout_place_order" value="登录" data-value="Login" style="float: right;" type="button">
                                              </li>
                                          </ul>
                                      </div>
                                  </div>
                              </div>
                          </div>

                      </form>
                  </div>
              </div>
          </div>
      </section>
  </div>
  <div th:replace="@{/include/fore_footer}::footer"></div>
  <script th:src="@{/mall/js/library/jquery.min.js}"></script>
  <script th:src="@{/mall/js/library/bootstrap.min.js}"></script>
  <script th:src="@{/mall/js/function-check-viewport.js}"></script>
  <script th:src="@{/mall/js/library/slick.min.js}"></script>
  <script th:src="@{/mall/js/library/select2.full.min.js}"></script>
  <script th:src="@{/mall/js/library/imagesloaded.pkgd.min.js}"></script>
  <script th:src="@{/mall/js/library/jquery.mmenu.all.min.js}"></script>
  <script th:src="@{/mall/js/library/rellax.min.js}"></script>
  <script th:src="@{/mall/js/library/isotope.pkgd.min.js}"></script>
  <script th:src="@{/mall/js/library/bootstrap-notify.min.js}"></script>
  <script th:src="@{/mall/js/library/bootstrap-slider.js}"></script>
  <script th:src="@{/mall/js/library/in-view.min.js}"></script>
  <script th:src="@{/mall/js/library/countUp.js}"></script>
  <script th:src="@{/mall/js/library/animsition.min.js}"></script>
  <script th:src="@{/mall/js/global.js}"></script>
  <script th:src="@{/mall/js/config-mm-menu.js}"></script>
  <script>
      $(document).ready(function () {
          $("#loginSubmit").click(function () {
              $.ajax({
                  url:'/customer/login',
                  type:'post',
                  data:$("#loginForm").serialize(),
                  success:function (data){
                   if(data==0){
                        // alert("登陆成功");
                       window.location.href="/fore/index";
                   }  else if(data==1){
                       alert("密码错误");
                   }else {
                       alert("用户名不存在");
                   }
                      $("#loginForm :input").not(":button, :submit, :reset, :hidden, :checkbox, :radio").val("");
                      $("#loginForm :input").removeAttr("checked").remove("selected");
                  }
              });
          });
      });
  </script>
  </body>
</html>

